package com.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

public class AspectXML {

    public void myBefore(JoinPoint joinPoint) {
        System.out.println("前置通知myBefore******" + joinPoint.getTarget() + "织入的目标" + joinPoint.getSignature().getName());
    }
    public void myAfter(JoinPoint joinPoint) {
        System.out.println("后置通知myAfter******" + joinPoint.getTarget() +"织入的目标" + joinPoint.getSignature().getName());
    }
    public Object myAround(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        System.out.println("环绕开始******");
        Object obj = proceedingJoinPoint.proceed();
        System.out.println("环绕结束******");
        return obj;
    }
    public void myAfterReturning(JoinPoint joinPoint) {
        System.out.println("后置返回通知myAfterReturning******" + joinPoint.getTarget() +"织入的目标" + joinPoint.getSignature().getName());
    }
    public void myException(JoinPoint joinPoint, Throwable e) {
        System.out.println("异常通知myException****** 出错信息：" + e.getMessage());
    }

}
